//package com.origin.learn.flume.service;
//
//import com.origin.learn.flume.bean.FlumePropertyConstant;
//import com.origin.learn.flume.bean.FlumeSource;
//
//import java.lang.reflect.Field;
//import java.util.List;
//
///**
// * @Description:
// * @Date: 2020/1/8
// * @Time: 14:26
// * @Created by:   dingtao
// * @Modified by:
// * @Modified at:
// */
//public interface FlumeSourceService {
//
////    default String getPropertyString(String agentName) throws IllegalAccessException {
////        StringBuilder stringBuilder = new StringBuilder();
////        Class sourceClass = this.getClass();
////        Class superClass = sourceClass.getSuperclass();
////        while (true) {
////            if (superClass != Object.class) {
////                Field[] fields = superClass.getDeclaredFields();
////                this.addProperties(stringBuilder, fields, agentName, true);
////                superClass = superClass.getSuperclass();
////            } else {
////                break;
////            }
////        }
////        Field[] fields = sourceClass.getDeclaredFields();
////        this.addProperties(stringBuilder, fields, agentName, false);
////        return stringBuilder.toString();
////    }
////
////    default void addProperties(StringBuilder var1, Field[] var2, String var3, boolean var4) throws IllegalAccessException {
////        for (Field field : var2) {
////            if (field.getType() == List.class) {
////                if (var4) {
////                    return;
////                }
////                var1.append(var3).append(FlumePropertyConstant.SOURCES)
////                        .append(".").append(((FlumeSource)this).name())
////                        .append(FlumePropertyConstant.CHANNELS)
////                        .append(" = ");
////                for (int i = 0; i < ((FlumeSource)this).setChannels().size(); i++) {
////                    var1.append(((FlumeSource)this).setChannels().get(i).name());
////                    if (i != ((FlumeSource)this).setChannels().size() - 1) {
////                        var1.append(",");
////                    }
////                }
////            } else {
////                if ("name".equals(field.getName())) {
////                    continue;
////                }
////                field.setAccessible(true);
////                var1.append(var3).append(FlumePropertyConstant.SOURCES)
////                        .append(".").append(((FlumeSource)this).name())
////                        .append(".").append(field.getName())
////                        .append(" = ")
////                        .append(field.get(this))
////                        .append("\n");
////            }
////        }
////    }
//
//}
